#include <iostream>
using namespace std;

typedef long long LL;
const int N = 1e5 + 10;
LL n, x;
LL a[N];
int gcd(int a, int b)
{
    return b == 0 ? a : gcd(b, a % b);
}
int main()
{
    cin >> n >> x;
    for (int i = 1; i <= n; i++)
        cin >> a[i];

    for (int i = 1; i <= n; i++)
    {
        if (x >= a[i])
            x += a[i];
        else
        {
            x += gcd(a[i], x);
        }
    }

    cout << x << endl;
    return 0;
}